package com.bcu.cn.service;

import com.bcu.cn.entity.VisitCounter;
import com.bcu.cn.mapper.VisitCounterMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class VisitCounterService {
    @Autowired
    private VisitCounterMapper mapper;

    public void increment() {
        mapper.updateCount();
    }

    public VisitCounter getCurrentCount() {
        return mapper.getCount();
    }
}